#include <iostream>
#include <assert.h>
#include <map>

#include "opcodedispatch.h"



class TestOpcode
{
BEGINE_OPCODEREG(TestOpcode)
	OPCODE_BIND("TestFunc", &TestOpcode::Func);
	OPCODE_BIND("TestFunc2", &TestOpcode::Func2);
END_OPCODEREG()
public:
	void Func()
	{
		std::cout << "TestOpcode Func" << std::endl;
	}

    void Func2(int a, int b)
	{
		std::cout << "TestOpcode func2:" << a*b << std::endl;
	}
};

int main()
{
	OpcodeCallEx("TestFunc2", 10, 20);
	

	/*COpcodeDispatchAgent::get_instance().Initialize();

    COpcodeDispatchAgent::get_instance().Dump();
	COpcodeDispatchAgent::get_instance().Dispatch("TestFunc");

    COpcodeDispatchAgent::get_instance().Dispatch("TestFunc2", 10, 20);*/
    return 0;
}